<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lua-nbt: nbt::Tag Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lua-nbt
   </div>
   <div id="projectbrief">Named Binary Tag library for Lua</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacenbt.html">nbt</a></li><li class="navelem"><a class="el" href="classnbt_1_1_tag.html">Tag</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classnbt_1_1_tag-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">nbt::Tag Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="nbt__dummy_8h_source.html">nbt_dummy.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a9f9a048f75558e9e6d88bd92dad74a35"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0">TagType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnbt_1_1_tag.html#a9f9a048f75558e9e6d88bd92dad74a35">getTypeID</a> ()</td></tr>
<tr class="separator:a9f9a048f75558e9e6d88bd92dad74a35"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38e33c5dd9913c7c826e10177812fa96"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacenbt.html#ace7731cf44f1f0d059794e786f2d42b8">string</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnbt_1_1_tag.html#a38e33c5dd9913c7c826e10177812fa96">getName</a> ()</td></tr>
<tr class="separator:a38e33c5dd9913c7c826e10177812fa96"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a367dd11e687116333ca8aab5e00cccef"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacenbt.html#ace7731cf44f1f0d059794e786f2d42b8">string</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnbt_1_1_tag.html#a367dd11e687116333ca8aab5e00cccef">getString</a> ()</td></tr>
<tr class="separator:a367dd11e687116333ca8aab5e00cccef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a969ed5b637c5d9581ab5c62973917ceb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacenbt.html#a1ec0d30c4bfec8a96b422179b9c1640c">number</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnbt_1_1_tag.html#a969ed5b637c5d9581ab5c62973917ceb">getNumber</a> ()</td></tr>
<tr class="separator:a969ed5b637c5d9581ab5c62973917ceb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8027c23e9d7982befcf60cea2da2b4b1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacenbt.html#ac96039b5f6f53c3e5f64be0807d772f2">integer</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnbt_1_1_tag.html#a8027c23e9d7982befcf60cea2da2b4b1">getInteger</a> ()</td></tr>
<tr class="separator:a8027c23e9d7982befcf60cea2da2b4b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38e3a675996f364912826fbdba2e6dec"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacenbt.html#a19905ad50c82e72526db0057144f6470">any</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnbt_1_1_tag.html#a38e3a675996f364912826fbdba2e6dec">getValue</a> ()</td></tr>
<tr class="separator:a38e3a675996f364912826fbdba2e6dec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab16f43cc0ee9c696827727391d79161a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnbt_1_1_tag.html">Tag</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnbt_1_1_tag.html#ab16f43cc0ee9c696827727391d79161a">copy</a> (bool shallow=false)</td></tr>
<tr class="separator:ab16f43cc0ee9c696827727391d79161a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59f0f71fae6e71384c4de2300481b9a7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacenbt.html#ace7731cf44f1f0d059794e786f2d42b8">string</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnbt_1_1_tag.html#a59f0f71fae6e71384c4de2300481b9a7">encode</a> (bool noprefix=false)</td></tr>
<tr class="separator:a59f0f71fae6e71384c4de2300481b9a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44c9265ad7a3d7e98a7bdd4866cef585"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnbt_1_1_tag.html#a44c9265ad7a3d7e98a7bdd4866cef585">operator string</a> ()</td></tr>
<tr class="separator:a44c9265ad7a3d7e98a7bdd4866cef585"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>NBT <a class="el" href="classnbt_1_1_tag.html">Tag</a> class </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="ab16f43cc0ee9c696827727391d79161a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab16f43cc0ee9c696827727391d79161a">&#9670;&nbsp;</a></span>copy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnbt_1_1_tag.html">Tag</a>* nbt::Tag::copy </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>shallow</em> = <code>false</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Copy the current tag and return new one with same value(s). </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">shallow</td><td>Only copy the upper values for array? By default this function will do deep copy. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a59f0f71fae6e71384c4de2300481b9a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a59f0f71fae6e71384c4de2300481b9a7">&#9670;&nbsp;</a></span>encode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespacenbt.html#ace7731cf44f1f0d059794e786f2d42b8">string</a> nbt::Tag::encode </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>noprefix</em> = <code>false</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Encode the current NBT tag to its binary representation. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">noprefix</td><td>Internal use. Always omit this when calling this function. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section warning"><dt>Warning</dt><dd>Care must be taken when calling this for type other than <a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0ac3b2486402281a430d49b1a459196c00">TAG_COMPOUND</a>. Some NBT parsers only decodes NBT data if it's begin with <a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0ac3b2486402281a430d49b1a459196c00">TAG_COMPOUND</a>. This library is not one of them. </dd></dl>

</div>
</div>
<a id="a8027c23e9d7982befcf60cea2da2b4b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8027c23e9d7982befcf60cea2da2b4b1">&#9670;&nbsp;</a></span>getInteger()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespacenbt.html#ac96039b5f6f53c3e5f64be0807d772f2">integer</a> nbt::Tag::getInteger </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get number representation of the NBT value. </p><dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">error</td><td>thrown if the value is not convertible to number. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section warning"><dt>Warning</dt><dd>This truncates the fraction part of the value if it's convertible to number. </dd></dl>

</div>
</div>
<a id="a38e33c5dd9913c7c826e10177812fa96"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a38e33c5dd9913c7c826e10177812fa96">&#9670;&nbsp;</a></span>getName()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespacenbt.html#ace7731cf44f1f0d059794e786f2d42b8">string</a> nbt::Tag::getName </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the tag name. May be empty string or <code>nil</code>. </p>

</div>
</div>
<a id="a969ed5b637c5d9581ab5c62973917ceb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a969ed5b637c5d9581ab5c62973917ceb">&#9670;&nbsp;</a></span>getNumber()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespacenbt.html#a1ec0d30c4bfec8a96b422179b9c1640c">number</a> nbt::Tag::getNumber </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get number representation of the NBT value. </p><dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">error</td><td>thrown if the value is not convertible to number. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a367dd11e687116333ca8aab5e00cccef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a367dd11e687116333ca8aab5e00cccef">&#9670;&nbsp;</a></span>getString()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespacenbt.html#ace7731cf44f1f0d059794e786f2d42b8">string</a> nbt::Tag::getString </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get string representation of the NBT value. </p><dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">error</td><td>thrown if the type is <a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0ac3b2486402281a430d49b1a459196c00">TAG_COMPOUND</a>, <a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0af97f4039d10b5baa39af2a666ff05486">TAG_LIST</a>, <a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0af86224107e7c82312447a2c56fb05a6f">TAG_BYTE_ARRAY</a>, <a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0ad9e8097789fbbb0864f7ab962adc407d">TAG_INT_ARRAY</a>, or <a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0a11f095453a5c229c777a885eb4d11f88">TAG_LONG_ARRAY</a>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a9f9a048f75558e9e6d88bd92dad74a35"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9f9a048f75558e9e6d88bd92dad74a35">&#9670;&nbsp;</a></span>getTypeID()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0">TagType</a> nbt::Tag::getTypeID </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get type ID of current NBT tag. </p>

</div>
</div>
<a id="a38e3a675996f364912826fbdba2e6dec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a38e3a675996f364912826fbdba2e6dec">&#9670;&nbsp;</a></span>getValue()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespacenbt.html#a19905ad50c82e72526db0057144f6470">any</a> nbt::Tag::getValue </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the value of the NBT tag.</p>
<ul>
<li>Number is returned for <a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0a190f7f37f387f7215246055e5fbd656f">TAG_BYTE</a>, <a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0abe4ee5e13fc7f3f35ba3c2d544b9fa8d">TAG_SHORT</a>, <a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0a367f9352d0b2e8621bda49127318e086">TAG_INT</a>, <a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0ada95f5b19bd2e9e17160cc9a1477b7d8">TAG_LONG</a>, <a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0a81548f1cdd75d6a5500533ac73773018">TAG_FLOAT</a>, and <a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0af3cb3a0b381059ae88ecc0139dd986d5">TAG_DOUBLE</a> type.</li>
<li>String is returned for <a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0a655593edca89bc6ed0a2ac5fc33c50c0">TAG_STRING</a> type.</li>
<li>Table is returned for <a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0af97f4039d10b5baa39af2a666ff05486">TAG_LIST</a>, <a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0ac3b2486402281a430d49b1a459196c00">TAG_COMPOUND</a> (key-value pairs), <a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0af86224107e7c82312447a2c56fb05a6f">TAG_BYTE_ARRAY</a>, <a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0ad9e8097789fbbb0864f7ab962adc407d">TAG_INT_ARRAY</a>, and <a class="el" href="namespacenbt.html#af736ee28323266257ce0e5d56e2669e0a11f095453a5c229c777a885eb4d11f88">TAG_LONG_ARRAY</a> type. </li>
</ul>

</div>
</div>
<a id="a44c9265ad7a3d7e98a7bdd4866cef585"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a44c9265ad7a3d7e98a7bdd4866cef585">&#9670;&nbsp;</a></span>operator string()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">nbt::Tag::operator <a class="el" href="namespacenbt.html#ace7731cf44f1f0d059794e786f2d42b8">string</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Dump the current NBT tag to human readable pretty-printed string representation. </p><dl class="section note"><dt>Note</dt><dd>The dump format follows <a href="https://github.com/TkTech/PyNBT">PyNBT</a> output. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="nbt__dummy_8h_source.html">nbt_dummy.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
